﻿using AutoMapper;
using Traceability.Doamin;
using Traceability.Write.Api.Application.Command;
using Traceability.Write.Api.Application.Command.CommodityCommand;

namespace Traceability.Write.Api
{
    public class AutoMapperProfile : Profile
    {
        public AutoMapperProfile()
        {
            //添加商品
            CreateMap<Commodity, AddCommodityCommand>().ReverseMap();
            //修改商品
            CreateMap<Commodity, UpdateCommodityCommand>().ReverseMap();
            //删除商品
            CreateMap<Commodity, DelCommodityCommand>().ReverseMap();
            //添加图片
            CreateMap<Imager, AddImagerCommand>().ReverseMap();
            //删除产品检验图片
            CreateMap<Imager, DelImageCommand>().ReverseMap();
            //添加养殖信息
            CreateMap<Cultivation, AddCultivationCommand>().ReverseMap();
            //添加免疫信息
            CreateMap<Immunity, AddImmunityCommand>().ReverseMap();
            //删除免疫信息
            CreateMap<Immunity, DelImmunityCommand>().ReverseMap();
            //修改免疫信息
            CreateMap<Immunity, UpdateImmunityCommand>().ReverseMap();
            //添加养殖企业
            CreateMap<Enterprise, AddEnterpriseCommand>().ReverseMap();
            //添加屠宰信息
            CreateMap<Slaughter, AddSlaughterCommand>().ReverseMap();
            //修改屠宰企业
            CreateMap<Enterprise, UpdateEnterpriseCommand>().ReverseMap();
            //修改供应商信息
            CreateMap<Enterprise, S_UpdateEnterpriseCommand>().ReverseMap();
            //修改供应商信息
            CreateMap<Vendor, AddVendorCommand>().ReverseMap();
        }
    }
}
